using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Security
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [Serializable, ActiveRecord("PowerSet")]
    public class PowerSet : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private bool canOpen;
        private bool canCreate;
        private bool canUpdate;
        private bool canDelete;
        private bool canSearch;
        private bool canPrint;
        private bool canExport;
        
        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access=PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [Property, PowerSetOption]
        public bool CanOpen
        {
            get { return canOpen; }
            set { canOpen = value; }
        }

        [Property, PowerSetOption]
        public bool CanCreate
        {
            get { return canCreate; }
            set { canCreate = value; }
        }

        [Property, PowerSetOption]
        public bool CanUpdate
        {
            get { return canUpdate; }
            set { canUpdate = value; }
        }

        [Property, PowerSetOption]
        public bool CanDelete
        {
            get { return canDelete; }
            set { canDelete = value; }
        }

        [Property, PowerSetOption]
        public bool CanSearch
        {
            get { return canSearch; }
            set { canSearch = value; }
        }

        [Property, PowerSetOption]
        public bool CanPrint
        {
            get { return canPrint; }
            set { canPrint = value; }
        }

        [Property, PowerSetOption]
        public bool CanExport
        {
            get { return canExport; }
            set { canExport = value; }
        }
    }
}